import {
  mapState,
  mapMutations,
  mapGetters
} from 'Vuex'
export default {
  watch: {
    totalCheckCount(){
         this.showTabbar()
    }
  },
  computed: {
    ...mapGetters('m_cart', ['totalCheckCount'])
  },
  onShow() {
    this.showTabbar()
  },
  methods: {
    showTabbar() {
      if(this.totalCheckCount<=0)return
      uni.setTabBarBadge({
        index: 2,
        text: this.totalCheckCount + ''
      })
    }
  }
}